import { getCatList } from '@/api'
import { GET_CATEGORYLIST_STORE } from '../constant-type'
const state = {
    categoryList: []
}
const actions = {
    async [GET_CATEGORYLIST_STORE]({ commit }) {
        try {
            let re = await getCatList()
            commit('setCatListStore', { List: re })
        } catch (error) {
            alert(error)
        }
    }
}
const mutations = {
    setCatListStore(state, payload) {
        state.categoryList = payload.List
    }
}
const getters = {}
export default {
    namespaced: true,
    state,
    actions,
    mutations,
    getters
}